package cn.yj.cgs.dba.mapper;

import cn.yj.annotation.pagehelper.annotation.StartPage;
import cn.yj.annotation.pagehelper.page.Page;
import cn.yj.cgs.dba.entity.Customer;
import cn.yj.cgs.dba.entity.vo.CustomerPcVo;
import cn.yj.cgs.dba.entity.vo.InviteesRanking;
import cn.yj.common.NameValue;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;


/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 永健
 * @since 2021-04-19 16:12:11
 */
public interface CustomerMapper extends BaseMapper<Customer> {
    @StartPage
    List<Customer> findList(@Param("map") Map<String, Object> map, @Param("page") Page<CustomerPcVo> page);

    @StartPage
    List<InviteesRanking> inviteesRankingList(@Param("map") Map<String, Object> params,@Param("page") Page<InviteesRanking> page);

    /**
     * 查询我所在的排名
     * @param userCode
     * @return
     */
    InviteesRanking selectMyRanking(String userCode);

    @StartPage
    List<InviteesRanking> selectCustomerByInvitees(@Param("userCode") String userCode,@Param("page") Page<InviteesRanking> page);

    Customer exitStudentCode(@Param("schoolName") String schoolName,@Param("studentCode") String studentCode);

    long countEffectiveCustomer(String userCode);

    long countAllUser();

    long countUserByDate(Date date);

    long countUserByDateRange(@Param("startTime") Date startDate,@Param("endTime") Date endDate);

    List<NameValue> pieChart();

    Customer selectConcatInfo(String customCode);

    Set<String> selectFollowersInviteCode(String myInviteCode);
}
